#ifndef PING_H
#define PING_H
#include "Publisher.h"
#include "Subscriber.h"
#include "Messages.pb.h"
#include <vector>


  class Ping
  {
    public:
      Ping();
      virtual ~Ping();
    private: //methods
      class MsgReader : public Subscriber::DataReaderTemplate<fsk::msg::Message02>
      {

        public:
          MsgReader(Ping& obj);

        private:
          void handle(fsk::msg::Message02& msg);
          Ping& obj_;
      };

      void sendResponse(fsk::msg::Message02& msg);
      double systemTime() const;

    private: //attributes
      Publisher pub_;
      Subscriber sub_;
      MsgReader reader_;
      double sendTime_;
      typedef std::vector<double> TimeStampList;
      TimeStampList ts_;
  };
#endif
